<?php
class Controller_Helper_Menu_Right extends Controller_Helper_Abstract
{
	public function __construct(Controller_Abstract $parentController)
	{
		parent::__construct('rightmenu', $parentController);
	}
	
	public function run()
	{
		$criteria = new Criteria();
		$criteria->addAscendingOrderByColumn(CategoriesPeer::NAME);
		
		$this->view()->assign('categories', CategoriesPeer::doSelect($criteria));
		
		$criteria->clear();
		$criteria->addAscendingOrderByColumn(VortalsPeer::NAME);
		$this->view()->assign('vortals', VortalsPeer::doSelect($criteria));
		
		$criteria->clear();
		$criteria->addDescendingOrderByColumn(NewsPeer::CLICKCOUNTER);
		$criteria->setLimit(7);
		$this->view()->assign('topnews', NewsPeer::doSelect($criteria));
		
		$requests = ReviewrequestsPeer::doSelect(new Criteria());
		$this->view()->assign('reviewrequests', $requests);
		
		if (Manager_User::isAdminLogged()) {
			$this->view()->assign('isAdmin', true);
		}
		
		$this->view()->display('rightmenu.tpl');
	}
}